package com.fulu.designmode.structural.decorator_pattern;

/**
 * 步骤4： 创建扩展了ShapeDecorator类的实体装饰类
 */
public class RedShapeDecorator extends ShapeDecorator {
    /**
     * 定义构造器传入要被装饰的shape对象
     *
     * @param decoratedShape
     */
    public RedShapeDecorator(Shape decoratedShape) {
        super(decoratedShape);
    }

    @Override
    public void draw() {
        decoratedShape.draw();
        setRedBorder(decoratedShape);
    }
    // 扩展一个给border上色的功能
    private void setRedBorder(Shape decoratedShape){
        System.out.println("Border Color: red");
    }
}
